import request from '@/utils/request'

/**
 * 小区内容渲染
 */
export function getCommunityApi() {
  return request({
    url: '/community'
  })
}
/**
 * 获取维修记录管理列表
 */
export function getmaintainlistApi(params) {
  return request({
    method: 'GET',
    url: '/device/maintain',
    params
  })
}
/**
 * 删除
 */
export function delmaintainlistApi(id) {
  return request({
    method: 'DELETE',
    url: `/device/maintain/${id}`
  })
}
/**
 * 新增维修记录
 */
export function addmaintainlistApi(data) {
  return request({
    method: 'POST',
    url: '/device/maintain',
    data
  })
}
/**
 * 回显
 */
export function getshowmaintainlistApi(id) {
  return request({
    method: 'GET',
    url: `/device/maintain/${id}`
  })
}
/**
 * 修改
 */
export function editmaintainlistApi(data) {
  return request({
    method: 'PUT',
    url: `/device/maintain/${data.id}`,
    data
  })
}
export const communityCode = params => request({
  method: 'GET',
  url: '/device/index',
  params
})
